<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-vvequiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="./demo.css">
</head>
<body>
    
<div class="map"></div>

<button class="start">开始</button>
<button class="stop">停止</button>
</body>
</html>
<script src="./snake.js"></script>
<script src="./food.js"></script>
<script src="./demo.js"></script>
<script src="./map.js"></script>
<script>
const g = new Game('.map')
const start = document.querySelector('.start')
start.addEventListener('click',() => g.start())
const stop = document.querySelector('.stop')
stop.addEventListener('click',() => g.stop())
</script>